package com.xiaogang.ggfw.config.mvc;

import com.xiaogang.ggfw.config.filter.SignInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ProjectName : caldav
 * @作者 : 侯小刚
 * @描述 :
 * @创建日期 : 2023/4/10 11:03
 */
@Configuration
public class MvcConfig implements WebMvcConfigurer {

    // 签名拦截器
    @Autowired
    private SignInterceptor signInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 签名校验的拦截器
        signInterceptor
                .addCheckUrls("/api/v1/service/dealOfd/ofdToImg");
        registry.addInterceptor(signInterceptor)
                .addPathPatterns("/api/v1/service/**");

    }

}
